# Copyright (c) 2020 cgsdfc
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT

from mako.template import Template
from mako.lookup import TemplateLookup
from pathlib import Path

PROJECT_BASE_DIR = Path(__file__).parent

TEMPLATE_DIRS = [PROJECT_BASE_DIR / 'template']

MODULE_DIR = '.mako_module'


def CreateMakoTemplate(template_path):
    template_path = str(template_path)
    lookup = TemplateLookup(directories=TEMPLATE_DIRS)
    return Template(filename=template_path,
                    module_directory=MODULE_DIR,
                    lookup=lookup)
